54e908edcd929a79560f4f41a00a06389f202a9f,src/com/redhat/ceylon/compiler/codegen/ExpressionTransformer.java,ExpressionTransformer,transformMemberExpression,#Tree.StaticMemberOrTypeExpression#JCExpression#,923

Before Change


        if (decl instanceof Getter) {
            // invoke the getter
            if (decl.isToplevel()) {
                result = makeGetter(makeFQIdent(decl.getContainer().getQualifiedNameString()), Util.quoteIfJavaKeyword(decl.getName()), Util.getGetterName(decl.getName()));
            } else if (decl.isClassMember()) {
                result =  makeGetter(primaryExpr, Util.getGetterName(decl.getName()));
            } else {
                // method local attr
                if (isRecursiveReference(expr)) {
                    result = makeGetter(primaryExpr, Util.getGetterName(decl.getName()));
                } else {
                    result = makeGetter(primaryExpr, decl.getName() + "$getter", Util.getGetterName(decl.getName()));
                }
            }
        } else if (decl instanceof Value) {
            if (decl.isToplevel()) {
                // ERASURE
                if ("null".equals(decl.getName())) {
                    // FIXME this is a pretty brain-dead way to go about erase I think
                    result = makeNull();
                } else if (isBooleanTrue(decl)) {
                    result = makeBoolean(true);
                } else if (isBooleanFalse(decl)) {
                    result = makeBoolean(false);
                } else {
                    // it's a toplevel attribute
                    result = makeGetter(makeFQIdent(decl.getContainer().getQualifiedNameString()), Util.quoteIfJavaKeyword(decl.getName()), Util.getGetterName(decl.getName()));
                }
            } else if (Decl.isClassAttribute(decl)) {
                // invoke the getter
                result = makeGetter(primaryExpr, Util.getGetterName(decl.getName()));
             } else if (decl.isCaptured() || decl.isShared()) {
                 // invoke the qualified getter
                 result = makeGetter(primaryExpr, decl.getName(), Util.getGetterName(decl.getName()));
            }
        } else if (decl instanceof Method) {
            if (Decl.withinMethod(decl)) {
                java.util.List<String> path = new LinkedList<String>();
                if (!isRecursiveReference(expr)) {
                    path.add(decl.getName());
                }
                path.add(Util.quoteMethodName(decl.getName()));
                result = makeIdent(path);
            } else if (decl.isToplevel()) {
                java.util.List<String> path = new LinkedList<String>();
                // FQN must start with empty ident (see https://github.com/ceylon/ceylon-compiler/issues/148)
                if (!decl.getContainer().getQualifiedNameString().isEmpty()) {
                    path.add("");
                	path.addAll(Arrays.asList(decl.getContainer().getQualifiedNameString().split("\\.")));
                } else {
                    path.add("");
                }
                // class
                path.add(Util.quoteIfJavaKeyword(decl.getName()));
                // method
                path.add(Util.quoteMethodName(decl.getName()));
                result = makeIdent(path);
            } else {
                result = makeIdentOrSelect(primaryExpr, Util.quoteMethodName(decl.getName()));
            }
        }
        if (result == null) {
            if (Util.isErasedAttribute(decl.getName())) {
                result = makeGetter(primaryExpr, Util.quoteMethodName(decl.getName()));
            } else {

After Change


            return make().Erroneous(List.<JCTree>nil());
        }
        
        String selector = null;
        if (decl instanceof Getter) {
            // invoke the getter
            if (decl.isToplevel()) {
                primaryExpr = makeIdentOrSelect(makeFQIdent(decl.getContainer().getQualifiedNameString()), Util.quoteIfJavaKeyword(decl.getName()));
                selector = Util.getGetterName(decl.getName());
            } else if (decl.isClassMember()) {
                selector = Util.getGetterName(decl.getName());
            } else {
                // method local attr
                if (!isRecursiveReference(expr)) {
                    primaryExpr = makeIdentOrSelect(primaryExpr, decl.getName() + "$getter");
                }
                selector = Util.getGetterName(decl.getName());
            }
        } else if (decl instanceof Value) {
            if (decl.isToplevel()) {
                // ERASURE
                if ("null".equals(decl.getName())) {
                    // FIXME this is a pretty brain-dead way to go about erase I think
                    result = makeNull();
                } else if (isBooleanTrue(decl)) {
                    result = makeBoolean(true);
                } else if (isBooleanFalse(decl)) {
                    result = makeBoolean(false);
                } else {
                    // it's a toplevel attribute
                    primaryExpr = makeIdentOrSelect(makeFQIdent(decl.getContainer().getQualifiedNameString()), Util.quoteIfJavaKeyword(decl.getName()));
                    selector = Util.getGetterName(decl.getName());
                }
            } else if (Decl.isClassAttribute(decl)) {
                // invoke the getter
                selector = Util.getGetterName(decl.getName());
             } else if (decl.isCaptured() || decl.isShared()) {
                 // invoke the qualified getter
                 primaryExpr = makeIdentOrSelect(primaryExpr, decl.getName());
                 selector = Util.getGetterName(decl.getName());
            }
        } else if (decl instanceof Method) {
            if (Decl.withinMethod(decl)) {
                java.util.List<String> path = new LinkedList<String>();
                if (!isRecursiveReference(expr)) {
                    path.add(decl.getName());
                }
                primaryExpr = makeIdent(path);
                selector = Util.quoteMethodName(decl.getName());
            } else if (decl.isToplevel()) {
                java.util.List<String> path = new LinkedList<String>();
                // FQN must start with empty ident (see https://github.com/ceylon/ceylon-compiler/issues/148)
                if (!decl.getContainer().getQualifiedNameString().isEmpty()) {
                    path.add("");
                	path.addAll(Arrays.asList(decl.getContainer().getQualifiedNameString().split("\\.")));
                } else {
                    path.add("");
                }
                // class
                path.add(Util.quoteIfJavaKeyword(decl.getName()));
                primaryExpr = makeIdent(path);
                // method
                selector = Util.quoteMethodName(decl.getName());
            } else {
                selector = Util.quoteMethodName(decl.getName());
            }
        }
        if (result == null) {
            boolean useGetter = !(decl instanceof Method);
            if (selector == null) {
                useGetter = Util.isErasedAttribute(decl.getName());
                if (useGetter) {
                    selector = Util.quoteMethodName(decl.getName());